{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\"UTF-8\""
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "### pry-docの読み込み\n",
    "require \"/root/jupyter/vendor/bundle/ruby/2.3.0/gems/pry-doc-0.10.0/lib/pry-doc\"\n",
    "#require \"/Users/ftakao2007/jupyter/vendor/bundle/ruby/2.3.0/gems/pry-doc-0.10.0/lib/pry-doc\"\n",
    "### エンコーディングをUTF-8に設定\n",
    "Encoding.default_external = \"UTF-8\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 概要\n",
    "\n",
    "* Slimとは\n",
    "    * Ruby製のテンプレートエンジン\n",
    "    * HTMLタグを短く書くことができる"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# インストール\n",
    "\n",
    "* Gemfile\n",
    "\n",
    "```\n",
    "================================================\n",
    "gem 'slim-rails'\n",
    "================================================\n",
    "```\n",
    "\n",
    "インストール手順\n",
    "\n",
    "```\n",
    "### インストール\n",
    "$ bundle install --path vendor/bundle\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# テスト実行\n",
    "\n",
    "\n",
    "```\n",
    "$ vi sample.slim\n",
    "================================================\n",
    "doctype html\n",
    "html\n",
    "  head\n",
    "    title Sample!\n",
    "  body\n",
    "    h1 Hello, World!\n",
    "    div#main-container\n",
    "      p\n",
    "        | おはよう\n",
    "        br\n",
    "        | こんにちは\n",
    "        br\n",
    "        a href=\"#\" おやすみ\n",
    "================================================\n",
    "\n",
    "$ bundle exec slimrb -p sample.slim > sample.html\n",
    "$ cat sample.html\n",
    "================================================\n",
    "<!DOCTYPE html>\n",
    "<html>\n",
    "  <head>\n",
    "    <title>Sample!</title>\n",
    "  </head>\n",
    "  <body>\n",
    "    <h1>\n",
    "      Hello, World!\n",
    "    </h1>\n",
    "    <div id=\"main-container\">\n",
    "      <p>\n",
    "        おはよう<br />こんにちは<br /><a href=\"#\">おやすみ</a>\n",
    "      </p>\n",
    "    </div>\n",
    "  </body>\n",
    "</html>\n",
    "================================================\n",
    "```"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Ruby 2.4.1",
   "language": "ruby",
   "name": "ruby"
  },
  "language_info": {
   "file_extension": ".rb",
   "mimetype": "application/x-ruby",
   "name": "ruby",
   "version": "2.4.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
